package com.hoshiibuy.fileServer.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.netflix.hystrix.HystrixCommands.PublisherBuilder;

import com.netflix.discovery.shared.resolver.DefaultEndpoint;
import com.obs.services.ObsClient;
import com.obs.services.ObsConfiguration;

/**
   *    华为云obs配置类
 * @author Mr.wu
 *
 */
public class ObsConfig {
	
	public static String accessKey;
	
	public static String secretAccessKey;
	
	public static String defaultEndpoint;
	

	private ObsConfig() {
	}

	@Value("${obs.accessKey}")
	public void setAccessKey(String accessKey) {
		ObsConfig.accessKey = accessKey;
	}

	@Value("${obs.secretAccessKey}")
	public void setSecretAccessKey(String secretAccessKey) {
		ObsConfig.secretAccessKey = secretAccessKey;
	}
	@Value("${obs.defaultEndpoint}")
	public void setDefaultEndpoint(String defaultEndpoint) {
		ObsConfig.defaultEndpoint = defaultEndpoint;
	}

	public static ObsConfiguration getDefaultConfig() {
		ObsConfiguration obsConfiguration=new ObsConfiguration();
		obsConfiguration.setEndPoint(defaultEndpoint);
		return obsConfiguration;
	}
}
